# -*- coding: utf-8 -*-
BOT_NAME = 'szzfcg'

SPIDER_MODULES = ['szzfcg.spiders']
NEWSPIDER_MODULE = 'szzfcg.spiders'
ROBOTSTXT_OBEY = False

CONCURRENT_REQUESTS = 18
# DOWNLOAD_DELAY = 1
CONCURRENT_REQUESTS_PER_DOMAIN = 18
CONCURRENT_REQUESTS_PER_IP = 18

# COOKIES_ENABLED = False
DEFAULT_REQUEST_HEADERS = {
    'Proxy-Connection': 'keep-alive',
    'Pragma': 'no-cache',
    'Cache-Control': 'no-cache',
    'Upgrade-Insecure-Requests': '1',
    'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8',
    'Accept-Encoding': 'gzip, deflate',
    'Accept-Language': 'zh-CN,zh;q=0.9',
}

DOWNLOADER_MIDDLEWARES = {
    'zc_core.middlewares.proxy.ProxyMiddleware': 650,
    'zc_core.middlewares.agent.UserAgentMiddleware': 640,
    'szzfcg.validator.BizValidator': 500
}
# PROXY_POOL_CLASS = 'zc_core.middlewares.proxies.mogu_pool.MoguProxyPool'
# 代理池中最少代理数量
MIN_PROXY_POOL_SIZE = 3
# 每次请求加载代理数量
PROXY_AMOUNT_PRE_LOAD = 2
# 标记离线商品续存批次数
MAX_OFFLINE_TIME = 2

EXTENSIONS = {
    'zc_core.extensions.batch_monitor.BatchMonitorExtension': 500,
}

ITEM_PIPELINES = {
    'zc_core.pipelines.brand.BrandCompletePipeline': 400,
    'zc_core.pipelines.supplier.SupplierCompletePipeline': 410,
    'zc_core.pipelines.mongo.MongoPipeline': 543,
    'zc_core.pipelines.box.BoxPipeline': 540,
}

# MongoDB配置
# MONGODB_URI = 'mongodb://localhost:27017'
MONGODB_URI = 'mongodb://root:Dangerous!@zc-outer.mongodb.rds.aliyuncs.com:3717'
# MONGODB_DATABASE = 'szzfcg_2019'

# 日志
LOG_LEVEL = 'INFO'
# 已采商品强制覆盖重采
# FORCE_RECOVER = True